#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright @ 2014 OPS, Qunar Inc. (qunar.com)
#
# Author: tingfang.bao <tingfang.bao@qunar.com>
# DateTime: 15-3-11 下午2:13
from flask import Flask
from lazy_view import LazyView


def index():
    return 'index'


app = Flask(__name__)

# 这里就不需要提前导入views.index了，用的时候再导入
app.add_url_rule('/', view_func=LazyView('views.index'))


def url(url_rule, import_name, **options):
    view = LazyView(import_name)
    app.add_url_rule(url_rule, view_func=view)


url('/about', 'views.about')

if __name__ == '__main__':
    app.run(debug=True)

